import { Injectable } from '@nestjs/common';
import { MailerService } from '@nest-modules/mailer';

@Injectable()
export class EmailService {
  constructor(private readonly mailerService: MailerService) {}

  sendEmail() {
    this.mailerService.sendMail({
      to: '1509778809@qq.com',
      from: '1931740796@qq.com',
      // subject: 'Testing Nest MailerModule ✔',
      subject: 'Lazy刚 向你发送了一封邮件 ✔',
      // html: '<b>Welcome Frost!</b>',
      template: './welcome',
      context: {
        // Data to be sent to template engine.
        code: '很高兴遇见你',
        username: 'Lazy刚',
      },
    });
  }
}
